﻿using SmartHotel.DAL;
using SmartHotel.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartHotel.BLL
{
    public class RoomTypeBLL
    {
        public RoomTypeBLL(RoomTypeDAL roomTypeDAL)
        {
            RoomTypeDAL = roomTypeDAL;
        }

        public RoomTypeDAL RoomTypeDAL { get; }

        public int Add(RoomType roomType)
        {
            return RoomTypeDAL.AddRoomType(roomType);
        }
        //查询
        public RoomType GetRoomTypeById(int id)
        {
            return RoomTypeDAL.GetRoomTypeById(id);
        }

        public int Delete(int id)
        {
            return RoomTypeDAL.Delete(id);
        }
        //更新
        public int Update(RoomType roomType)
        {

            return RoomTypeDAL.Update(roomType);
        }
        /// <summary>
        /// 获取所有房型
        /// </summary>
        /// <returns></returns>
        public List<RoomType> GetRoomTypes()
        {
            return RoomTypeDAL.GetRoomTypes();
        }
    }
}
